﻿(function(){
	if(!Mui){
		return;
	}
	
	Mui.ready(function(Mui){
		Mui.use('mammoo.form',function(Mui){
			var f=new Mammoo.form({
				action:'/service/member.ashx',
				op:'login',
				id:'mo_login',
				validate:[{
					name:'username',
					rules:{
						required:true,
						rangelength:[6,10]
					},
					message:{
						required:'请输入用户名',
						rangelength:'用户名介于{0}-{1}位'
					}
				},{
					name:'password',
					rules:{
						required:true,
						rangelength:[6,10]
					},
					message:{
						required:'请输入密码',
						rangelength:'用户名介于{0}-{1}位'
					}
				}],
				inModel:false,
				success:function(result){
					Mui.tip.tips(result.msg);
					window.location.href="/";
				},
				fail:function(result){
					Mui.tip.tips(result.msg);
				}
			});
		});
	});
})();